<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<security:authorize ifAllGranted="ROLE_USER">

<div id="heading" class="section">
	<h2>Validando la informacion</h2>
</div>
<p>
    Verifica que la informacion sea correcta  <br/>
    antes de registrar tu lista y enviar<br/>
    los correos a tus amigos

</p>
<div id="hotelResults" class="section">

    <form:form action="finalizaAmigos" method="post">
        <div class="field">
                <div class="label">Lista Discotecas:</div>
                <div class="input">${discoteca.nombre}</div>
          </div>
        
 <div class="field">
<c:if test="${empty contactos}">
   No hay amigos registrados
</c:if>
    <c:if test="${not empty contactos}">
	<table class="summary">
		<thead>
			<tr>
                            <th>Nombre:</th>
                            <th>Email:</th>
                            <th>Action:</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="amigo" items="${contactos}">
				<tr>
					<td>${amigo.nombre}</td>
					<td>${amigo.correo}</td>
					<td><a href="detele?id=${amigo.codigo}">Quitar</a></td>
				</tr>
			</c:forEach>
			<c:if test="${empty contactos}">
				<tr>
					<td colspan="5">No tiene aun amigos registrados..</td>
				</tr>
			</c:if>
		</tbody>
	</table>
	<div class="buttonGroup">
		<c:if test="${searchCriteria.page > 0}">
			<a id="prevResultsLink" href="search?searchString=${searchCriteria.searchString}&pageSize=${searchCriteria.pageSize}&page=${searchCriteria.page - 1}">Previous Results</a>
			<script type="text/javascript">
				Spring.addDecoration(new Spring.AjaxEventDecoration({
					elementId: "prevResultsLink",
					event: "onclick",
					params: {fragments: "body"}
				}));
			</script>
		</c:if>
		<c:if test="${not empty hotelList && fn:length(hotelList) == searchCriteria.pageSize}">
			<a id="moreResultsLink" href="search?searchString=${searchCriteria.searchString}&pageSize=${searchCriteria.pageSize}&page=${searchCriteria.page + 1}">More Results</a>
			<script type="text/javascript">
				Spring.addDecoration(new Spring.AjaxEventDecoration({
					elementId: "moreResultsLink",
					event: "onclick",
					params: {fragments: "body"}
				}));
			</script>
		</c:if>
	</div>
    </c:if>
     </div>
        &nbsp;<br/>
        &nbsp;<br/>
	<div class="buttonGroup">
            <input type="submit" name="submitform" value="Finalizar"/>
	</div>
        </form:form>
</div>	

</security:authorize>